package j06qita;

public class J2state {
    public static void main(String[] args) {
        Thread main = Thread.currentThread();

        Thread t1 = new Thread(()->{
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println("子中看父线程-"+main.getState());
            for (int i = 0; i < 100; i++) {
                System.out.println("i = " + i+
                        Thread.currentThread().getState());
            }

        });

        System.out.println(t1.getState());//NEW
        t1.start();

        try {
            Thread.sleep(10000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        System.out.println(t1.getState());//RUNNABLE

    }
}
